def fun1(a):
    def fun2():
        global a
        a = 1
        print(a)
    fun2()
    print(a)

fun1(2)
print(a)